import { Card, Descriptions } from 'antd'
import React from 'react'
import { connect } from 'umi'
import './MyInfo.less'
import moment from 'moment'

const MyInfo = ({ currentUser }) => {
  return (
    <Card
      bordered={false}
      title="我的信息"
      style={{ height: '100%' }}
    >
      <div className="my-info">
        <div className="my-info__base">
          <div className="my-info__base-info">
            <div className="my-info__base-info-image">
              <img src={currentUser.avatar}/>
            </div>
            <div className="my-info__base-info-label">
              <Descriptions column={1}>
                <div>{currentUser.name}</div>
                <div>{currentUser.orgname}</div>
                <Descriptions.Item label="入职时间">{moment(currentUser.hiredate).format('YYYY-MM-DD')}</Descriptions.Item>
                {/*<Descriptions.Item label="生日">{moment(currentUser.hiredate).format('YYYY-MM-DD')}</Descriptions.Item>*/}
              </Descriptions>
            </div>
          </div>
          <div className="my-info__base-tips">

          </div>
        </div>

        <div className="my-info__honor-wall">

        </div>
      </div>
    </Card>
  )
}

export default connect(({ user = {} }) => ({
  currentUser: user?.currentUser
}))(MyInfo)

